//
//  ProOrderSubListCell.m
//  BaseProject
//
//  Created by 王洋 on 2020/7/27.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "ProOrderSubListCell.h"

@implementation ProOrderSubListCell

- (void)awakeFromNib {
    [super awakeFromNib];

}

-(void)layoutSubviews {
    [super layoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.mainImageView pp_clipCorners:UIRectCornerAllCorners radius:6];
    });
}

- (void)fillCellWithModel:(OrderGoodsModel *)model {
    
    [self.mainImageView sd_setImageWithURL:[NSURL URLWithString:model.goodsImg] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    self.mainTitleLab.text = model.ogGoodsName;
    
    self.skuLab.text = model.sellerGoodsSpecs.specName;
    self.priceLab.text = [NSString stringWithFormat:@"¥%@",[Utilities changeDoubleToString:model.sellerGoodsSpecs.specPrice]];
    self.countLab.text = [NSString stringWithFormat:@"x%ld",(long)model.ogGoodsNum];
    
}

- (void)fillCellWithDetailModel:(CommonOrderGoodsModel *)model {
    
    [self.mainImageView sd_setImageWithURL:[NSURL URLWithString:model.specImage] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    self.mainTitleLab.text = model.ogGoodsName;
    
    self.skuLab.text = model.specName;
    self.priceLab.text = [NSString stringWithFormat:@"原价:¥%@  实付:¥%@",[Utilities changeDoubleToString:model.ogTotal],[Utilities changeDoubleToString:model.ogPayPrice]];
    self.countLab.text = [NSString stringWithFormat:@"共%ld件",(long)model.ogGoodsNum];
}



@end
